<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>3、有一个数组存了 1 万个字符串，如何把一万个字符串分成 N 组，当输入第 N 组时，打印该组的所有元素 </title>
</head>

<body>
  <script>
    let arr = ['12', '23', '34', '45', '56', '67', '78', '89', '90', '09', '98', '87', '76', '65', '54', '43', '32', '21']
    let result = [];
    //让数组每次循环+2个
    for (let i = 0; i < arr.length; i += 2) {
      //提取数组的某个部分
      result.push(arr.slice(i, i + 2))
    }
    let n = prompt('')
    console.log(result[n - 1])
  </script>

</body>

</html>